package com.usernet.product.dao;

import java.sql.Timestamp;
import java.util.HashMap;
import java.util.Map;

import com.usernet.product.comm.BaseDao;
import com.usernet.product.entity.Log;
import com.usernet.product.utils.Page;
import com.usernet.product.utils.PageResult;

public class LogDao extends BaseDao {

	@SuppressWarnings("unchecked")
	public PageResult<Log> getAllByPage(Page page) {
		String hql = "from Log order by id";
		return super.getAllByPageAndHql(page, hql);
	}

	@SuppressWarnings("unchecked")
	public PageResult<Log> getAllByPageByParam(Page page, Timestamp beginTime,
			Timestamp endTime) {
		String hql = "from Log where time>=:beginTime and time<=:endTime order by id";
		Map<String, Timestamp> map = new HashMap<String, Timestamp>();
		map.put("beginTime", beginTime);
		map.put("endTime", endTime);
		return super.getAllByPageAndHql(page, hql, map);
	}
}
